package com.example.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RefreshScope
public class TestController {
    @Resource
    private RestTemplate restTemplate;

    @Value("${user.name}")
    private String name;

    @GetMapping("/name")
    public String name(){
//        restTemplate.postForLocation("http://localhost:8888/actuator/refresh",null);
        return name;
    }
}
